package cn.wizzer.app.user.modules.models;

import cn.wizzer.framework.base.model.BaseModel;
import lombok.Data;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
import org.nutz.integration.json4excel.annotation.J4EIgnore;

/**
 * 群成员
 */
@Data
@Table("group_member")
@TableIndexes({@Index(name = "INDEX_CT_AT", fields = {"ctAt"}, unique = false)})
public class GroupMember extends BaseModel {

    @Column
    @Name
    @Comment("ID")
    @J4EIgnore
    @ColDefine(type = ColType.VARCHAR, width = 32)
    @PrevInsert(uu32 = true)
    private String id;

    @Column
    @ColDefine(type = ColType.VARCHAR,width = 32)
    private String userId;

    @Column
    @ColDefine(type = ColType.VARCHAR,width = 32)
    private String groupId;

    @Column
    @Comment("管理标志 0代表普通成员,1代表是管理员,2代表是群主")
    @ColDefine(type = ColType.INT, width = 4)
    @Default(value = "0")
    private Integer manager;

    @Column
    @Comment("创建时间")
    @PrevInsert(els = @EL("$me.now()"))
    private Long ctAt;

    @Column
    @Comment("排序")
    @ColDefine(type = ColType.INT, width = 4)
    private Integer sort;
}
